package com.ruoyi.peizhen.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.peizhen.mapper.BusinessBindserverMapper;
import com.ruoyi.peizhen.domain.BusinessBindserver;
import com.ruoyi.peizhen.service.IBusinessBindserverService;
import com.ruoyi.common.core.text.Convert;

/**
 * 业务医院绑定Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-13
 */
@Service
public class BusinessBindserverServiceImpl implements IBusinessBindserverService 
{
    @Autowired
    private BusinessBindserverMapper businessBindserverMapper;

    /**
     * 查询业务医院绑定
     * 
     * @param id 业务医院绑定主键
     * @return 业务医院绑定
     */
    @Override
    public BusinessBindserver selectBusinessBindserverById(Long id)
    {
        return businessBindserverMapper.selectBusinessBindserverById(id);
    }

    /**
     * 查询业务医院绑定列表
     * 
     * @param businessBindserver 业务医院绑定
     * @return 业务医院绑定
     */
    @Override
    public List<BusinessBindserver> selectBusinessBindserverList(BusinessBindserver businessBindserver)
    {
        return businessBindserverMapper.selectBusinessBindserverList(businessBindserver);
    }

    /**
     * 新增业务医院绑定
     * 
     * @param businessBindserver 业务医院绑定
     * @return 结果
     */
    @Override
    public int insertBusinessBindserver(BusinessBindserver businessBindserver)
    {
        businessBindserver.setCreateTime(DateUtils.getNowDate());
        return businessBindserverMapper.insertBusinessBindserver(businessBindserver);
    }

    /**
     * 修改业务医院绑定
     * 
     * @param businessBindserver 业务医院绑定
     * @return 结果
     */
    @Override
    public int updateBusinessBindserver(BusinessBindserver businessBindserver)
    {
        businessBindserver.setUpdateTime(DateUtils.getNowDate());
        return businessBindserverMapper.updateBusinessBindserver(businessBindserver);
    }

    /**
     * 批量删除业务医院绑定
     * 
     * @param ids 需要删除的业务医院绑定主键
     * @return 结果
     */
    @Override
    public int deleteBusinessBindserverByIds(String ids)
    {
        return businessBindserverMapper.deleteBusinessBindserverByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除业务医院绑定信息
     * 
     * @param id 业务医院绑定主键
     * @return 结果
     */
    @Override
    public int deleteBusinessBindserverById(Long id)
    {
        return businessBindserverMapper.deleteBusinessBindserverById(id);
    }
}
